package handler

import (
	"gofile/src/config"
	"gofile/src/util"
	"net/http"
	"os"
)

func CreateDirHandler(w http.ResponseWriter, r *http.Request) {
	params := r.URL.Query()
	file := params.Get("file")
	myCfg := config.GetConfig()
	path := myCfg.File.Dir + file
	err := os.MkdirAll(path, os.ModePerm)
	if err != nil {
		util.ProcessResult("创建文件"+path+"失败", err, w)
	} else {
		util.ProcessResult("创建文件"+path+"成功", err, w)
	}

}
